import gugga.collections.HashTable;
import gugga.tween.AbstractTween;

/**
 * @author Todor Kolev
 */
class gugga.tween.TimeTween extends AbstractTween 
{
	private var mLastTimer : Number; 
	
	public function TimeTween(aSubject : Object, aTweenedProperties : HashTable) 
	{
		super(aSubject, aTweenedProperties);
		mLastTimer = getTimer();
	}
	
	private function increaseDurationElapsed() : Void
	{
		var currentTimer : Number = getTimer();
		
		mDurationElapsed += (currentTimer - mLastTimer) / 1000;
		mLastTimer = currentTimer;
		
		if(mDurationElapsed > Duration)
		{
			mDurationElapsed = Duration;
		}
	}
}